function getCondition(inputList){
    var zhangfuValue=$('#zhangfu').val();
    var banTimeValue=$('#ban_time').val();
    var firstBanMoneyValue=$('#first_ban_money').val();
    var lastBanMoneyValue=$('#last_ban_money').val();
    var maxBanMoneyValue=$('#max_ban_money').val();
    var totalBanMoneyValue=$('#total_ban_money').val();
    var buyOneMoneyValue=$('#buy_one_money').val();
    var totalMoneyValue=$('#total_money').val();
    var floatMoneyValue=$('#float_money').val();
    // if (zhangfuValue=='全部')
    var chooses=[];
    var ranges=[];

    if (zhangfuValue=='涨停'){
        each_dict={};
        each_dict['type']='now_zhangting_status';
        each_dict['value']='涨停';
        chooses.push(each_dict);
    }
    if (zhangfuValue=='非涨停'){
        each_dict={};
        each_dict['type']='now_zhangting_status';
        each_dict['value']='非涨停';
        chooses.push(each_dict);
    }

    if(banTimeValue=='10点前'){
        each_dict={};
        each_dict['type']='new_lzt_time';
        each_dict['low']='09:30:00';
        each_dict['high']='10:00:00';
        ranges.push(each_dict);
    }
    if(banTimeValue=='10点至11点半'){
        each_dict={};
        each_dict['type']='new_lzt_time';
        each_dict['low']='10:00:00';
        each_dict['high']='11:30:00';
        ranges.push(each_dict);
    }
    if(banTimeValue=='下午'){
        each_dict={};
        each_dict['type']='new_lzt_time';
        each_dict['low']='13:00:00';
        each_dict['high']='15:00:00';
        ranges.push(each_dict);
    }

    if (firstBanMoneyValue=='小于300万'){
        each_dict={};
        each_dict['type']='first_lzt_deal_amount';
        each_dict['low']=0;
        each_dict['high']=3000000;
        ranges.push(each_dict);
    }
    if (firstBanMoneyValue=='300-600'){
        each_dict={};
        each_dict['type']='first_lzt_deal_amount';
        each_dict['low']=3000000;
        each_dict['high']=6000000;
        ranges.push(each_dict);
    }
    if (firstBanMoneyValue=='600-1000'){
        each_dict={};
        each_dict['type']='first_lzt_deal_amount';
        each_dict['low']=6000000;
        each_dict['high']=10000000;
        ranges.push(each_dict);
    }
    if (firstBanMoneyValue=='1000-1500'){
        each_dict={};
        each_dict['type']='first_lzt_deal_amount';
        each_dict['low']=10000000;
        each_dict['high']=15000000;
        ranges.push(each_dict);
    }
    if (firstBanMoneyValue=='大于1500'){
        each_dict={};
        each_dict['type']='first_lzt_deal_amount';
        each_dict['low']=15000000;
        //设置一个上界
        each_dict['high']=100000000*100000000;
        ranges.push(each_dict);
    }

    if (lastBanMoneyValue=='小于300万'){
        each_dict={};
        each_dict['type']='new_lzt_deal_amount';
        each_dict['low']=0;
        each_dict['high']=3000000;
        ranges.push(each_dict);
    }
    if (lastBanMoneyValue=='300-600'){
        each_dict={};
        each_dict['type']='new_lzt_deal_amount';
        each_dict['low']=3000000;
        each_dict['high']=6000000;
        ranges.push(each_dict);
    }
    if (lastBanMoneyValue=='600-1000'){
        each_dict={};
        each_dict['type']='new_lzt_deal_amount';
        each_dict['low']=6000000;
        each_dict['high']=10000000;
        ranges.push(each_dict);
    }
    if (lastBanMoneyValue=='1000-1500'){
        each_dict={};
        each_dict['type']='new_lzt_deal_amount';
        each_dict['low']=10000000;
        each_dict['high']=15000000;
        ranges.push(each_dict);
    }
    if (lastBanMoneyValue=='大于1500'){
        each_dict={};
        each_dict['type']='new_lzt_deal_amount';
        each_dict['low']=15000000;
        //设置一个上界
        each_dict['high']=100000000*100000000;
        ranges.push(each_dict);
    }

    if (maxBanMoneyValue=='小于300万'){
        each_dict={};
        each_dict['type']='max_lzt_deal_amount';
        each_dict['low']=0;
        each_dict['high']=3000000;
        ranges.push(each_dict);
    }
    if (maxBanMoneyValue=='300-600'){
        each_dict={};
        each_dict['type']='max_lzt_deal_amount';
        each_dict['low']=3000000;
        each_dict['high']=6000000;
        ranges.push(each_dict);
    }
    if (maxBanMoneyValue=='600-1000'){
        each_dict={};
        each_dict['type']='max_lzt_deal_amount';
        each_dict['low']=6000000;
        each_dict['high']=10000000;
        ranges.push(each_dict);
    }
    if (maxBanMoneyValue=='1000-1500'){
        each_dict={};
        each_dict['type']='max_lzt_deal_amount';
        each_dict['low']=10000000;
        each_dict['high']=15000000;
        ranges.push(each_dict);
    }
    if (maxBanMoneyValue=='大于1500'){
        each_dict={};
        each_dict['type']='max_lzt_deal_amount';
        each_dict['low']=15000000;
        //设置一个上界
        each_dict['high']=100000000*100000000;
        ranges.push(each_dict);
    }

    if (totalBanMoneyValue=='小于1000万'){
        each_dict={};
        each_dict['type']='ban_deal_amount';
        each_dict['low']=0;
        each_dict['high']=10000000;
        ranges.push(each_dict);
    }
    if (totalBanMoneyValue=='1000-5000'){
        each_dict={};
        each_dict['type']='ban_deal_amount';
        each_dict['low']=10000000;
        each_dict['high']=50000000;
        ranges.push(each_dict);
    }
    if (totalBanMoneyValue=='5000-1亿'){
        each_dict={};
        each_dict['type']='ban_deal_amount';
        each_dict['low']=50000000;
        each_dict['high']=100000000;
        ranges.push(each_dict);
    }
    if (totalBanMoneyValue=='1亿-2亿'){
        each_dict={};
        each_dict['type']='ban_deal_amount';
        each_dict['low']=100000000;
        each_dict['high']=200000000;
        ranges.push(each_dict);
    }
    if (totalBanMoneyValue=='2亿-3亿'){
        each_dict={};
        each_dict['type']='ban_deal_amount';
        each_dict['low']=200000000;
        each_dict['high']=300000000;
        ranges.push(each_dict);
    }
    if (totalBanMoneyValue=='大于3亿'){
        each_dict={};
        each_dict['type']='ban_deal_amount';
        each_dict['low']=300000000;
        //设置一个上界
        each_dict['high']=100000000*100000000;
        ranges.push(each_dict);
    }

    if (buyOneMoneyValue=='小于1000万'){
        each_dict={};
        each_dict['type']='buy_one';
        each_dict['low']=0;
        each_dict['high']=10000000;
        ranges.push(each_dict);
    }
    if (buyOneMoneyValue=='1000-5000'){
        each_dict={};
        each_dict['type']='buy_one';
        each_dict['low']=10000000;
        each_dict['high']=50000000;
        ranges.push(each_dict);
    }
    if (buyOneMoneyValue=='5000-1亿'){
        each_dict={};
        each_dict['type']='buy_one';
        each_dict['low']=50000000;
        each_dict['high']=100000000;
        ranges.push(each_dict);
    }
    if (buyOneMoneyValue=='1亿-2亿'){
        each_dict={};
        each_dict['type']='buy_one';
        each_dict['low']=100000000;
        each_dict['high']=200000000;
        ranges.push(each_dict);
    }
    if (buyOneMoneyValue=='2亿-3亿'){
        each_dict={};
        each_dict['type']='buy_one';
        each_dict['low']=200000000;
        each_dict['high']=300000000;
        ranges.push(each_dict);
    }
    if (buyOneMoneyValue=='大于3亿'){
        each_dict={};
        each_dict['type']='buy_one';
        each_dict['low']=300000000;
        //设置一个上界
        each_dict['high']=100000000*100000000;
        ranges.push(each_dict);
    }

    if (totalMoneyValue=='小于5000万'){
        each_dict={};
        each_dict['type']='total_deal_amount';
        each_dict['low']=0;
        each_dict['high']=50000000;
        ranges.push(each_dict);
    }
    if (totalMoneyValue=='5000-1亿'){
        each_dict={};
        each_dict['type']='total_deal_amount';
        each_dict['low']=50000000;
        each_dict['high']=100000000;
        ranges.push(each_dict);
    }
    if (totalMoneyValue=='1亿-2亿'){
        each_dict={};
        each_dict['type']='total_deal_amount';
        each_dict['low']=100000000;
        each_dict['high']=200000000;
        ranges.push(each_dict);
    }
    if (totalMoneyValue=='2亿-4亿'){
        each_dict={};
        each_dict['type']='total_deal_amount';
        each_dict['low']=200000000;
        each_dict['high']=400000000;
        ranges.push(each_dict);
    }
    if (totalMoneyValue=='4亿-6亿'){
        each_dict={};
        each_dict['type']='total_deal_amount';
        each_dict['low']=400000000;
        each_dict['high']=600000000;
        ranges.push(each_dict);
    }
    if (totalMoneyValue=='6亿-8亿'){
        each_dict={};
        each_dict['type']='total_deal_amount';
        each_dict['low']=600000000;
        each_dict['high']=800000000;
        ranges.push(each_dict);
    }
    if (totalMoneyValue=='6亿-8亿'){
        each_dict={};
        each_dict['type']='total_deal_amount';
        each_dict['low']=600000000;
        //设置一个上界
        each_dict['high']=800000000;
        ranges.push(each_dict);
    }
    if (totalMoneyValue=='大于8亿'){
        each_dict={};
        each_dict['type']='total_deal_amount';
        each_dict['low']=800000000;
        //设置一个上界
        each_dict['high']=100000000*100000000;
        ranges.push(each_dict);
    }

    if (floatMoneyValue=='小于5亿'){
        each_dict={};
        each_dict['type']='float_money';
        each_dict['low']=0;
        each_dict['high']=500000000;
        ranges.push(each_dict);
    }
    if (floatMoneyValue=='5亿-10亿'){
        each_dict={};
        each_dict['type']='float_money';
        each_dict['low']=500000000;
        each_dict['high']=1000000000;
        ranges.push(each_dict);
    }
    if (floatMoneyValue=='10亿-15亿'){
        each_dict={};
        each_dict['type']='float_money';
        each_dict['low']=1000000000;
        each_dict['high']=1500000000;
        ranges.push(each_dict);
    }
    if (floatMoneyValue=='15亿-20亿'){
        each_dict={};
        each_dict['type']='float_money';
        each_dict['low']=1500000000;
        each_dict['high']=2000000000;
        ranges.push(each_dict);
    }
    if (floatMoneyValue=='20亿-50亿'){
        each_dict={};
        each_dict['type']='float_money';
        each_dict['low']=2000000000;
        each_dict['high']=5000000000;
        ranges.push(each_dict);
    }
    if (floatMoneyValue=='50亿-100亿'){
        each_dict={};
        each_dict['type']='float_money';
        each_dict['low']=5000000000;
        each_dict['high']=10000000000;
        ranges.push(each_dict);
    }
    if (floatMoneyValue=='100亿-150亿'){
        each_dict={};
        each_dict['type']='float_money';
        each_dict['low']=10000000000;
        //设置一个上界
        each_dict['high']=15000000000;
        ranges.push(each_dict);
    }
    if (floatMoneyValue=='150亿以上'){
        each_dict={};
        each_dict['type']='float_money';
        each_dict['low']=15000000000;
        //设置一个上界
        each_dict['high']=100000000*100000000;
        ranges.push(each_dict);
    }

    var inputList=choosesFilter(inputList,chooses);
    var outputList=rangesFilter(inputList,ranges);
    return outputList;
}
function rangesFilter(inputList,ranges){
    if (ranges.length==0){
        return inputList;
    }else{
        for (let range of ranges){
            inputList=inputList.filter(
                function (item) {
                    // return parseFloat(item[range.type]>=range.low) && parseFloat(item[range.type]<=range.high);
                    return item[range.type]>=range.low && item[range.type]<=range.high;
                }
            );
        }
        return inputList;
    }

}
function choosesFilter(inputList,chooses){
    let tmpList=[];
    if(chooses.length==0){
        tmpList=inputList;
        return tmpList;
    }else{
        for (let choice of chooses){
            tmpList=tmpList.concat(inputList.filter(
                function (item) {
                    return item[choice.type].indexOf(choice.value)==0;
                }
                )
            );
        }
        return tmpList;
    }
}
function query(){

    addData();
}
function clearCondition(){
    $('#zhangfu').val('全部');
    $('#ban_time').val('全部');
    $('#first_ban_money').val('全部');
    $('#last_ban_money').val('全部');
    $('#max_ban_money').val('全部');
    $('#total_ban_money').val('全部');
    $('#buy_one_money').val('全部');
    $('#total_money').val('全部');
    $('#float_money').val('全部');
}